package com.wzp.yyptproject.until;

import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;

public class UtilBase64 {
    public static void main(String[] args) throws IOException {
//        String docUploadPath = "D:\\yyptproject\\yyptproject\\src\\main\\web\\img\\697efea24a0a66c4db84c78f6e89e6eb.jpg";
        String url = "ftp://192.168.195.1:21/yypt/697efea24a0a66c4db84c78f6e89e6eb.jpg";

        File refereeFile = new File(url);
        byte[] refereeFileOriginalBytes = FileUtils.readFileToByteArray(refereeFile);
        byte[] refereeFileBase64Bytes = Base64.encodeBase64(refereeFileOriginalBytes);
        String UpFile = new String(refereeFileBase64Bytes, "UTF-8");
        System.out.println(UpFile);

    }
}
